package com.lwt.controller;

import com.lwt.po.FriendLink;
import com.lwt.service.FriendLinkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;

/**
 * @program: blog
 * @author: 关键我是大怪
 * @create: 2021-08-04 14:36
 */
@Controller
public class FriendLinkController {
    @Autowired
    private FriendLinkService friendLinkService;

    @GetMapping("/friends")
    public String friends(Model model) {
        List<FriendLink> friendLinks = friendLinkService.listFriendLink();
        model.addAttribute("friendlinks", friendLinks);
        return "friends";
    }
}
